home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / demos / howtoskinacat / nynexcube / rotate-aga3.s next >
Text File  |  1980-01-03  |  39KB  |  1,855 lines

  1. ùúùúÿðKÿðKÿðKÿðKÿðKÿðKÿðKÿðKÿðK;------------------T--------T
  2. Track:    EQU    0
  3. Raster:    EQU    0
  4. A1200:    EQU    0
  5.  
  6.     IFEQ    A1200-1
  7. MatrixSize:    EQU    13
  8. ECS:    EQU    0
  9.     ELSE
  10. MatrixSize:    EQU    11
  11. ECS:    EQU    1
  12.     ENDC
  13.  
  14.  
  15. MyDmacon=%01111100000
  16. ;         abcdefghhhh
  17. ; a = Blitter nasty
  18. ; b = Enable DMA activity (always set this!)
  19. ; c = Bitplane enable
  20. ; d = Copper enable
  21. ; e = Blitter enable
  22. ; f = Sprite enable
  23. ; g = Disk enable
  24. ; h = Audio channels enable
  25.  
  26. MyIntena=%100000000100000
  27. ;         abcdeeeefghijkl
  28. ; a = Enable interrupts
  29. ; b = Lev. 6 External interrupt
  30. ; c = Lev. 5 Disk sync found
  31. ; d = Lev. 5 Serial port receive buffer full
  32. ; e = Lev. 4 Audio ch. 3-0 block finished
  33. ; f = Lev. 3 Blitter finished
  34. ; g = Lev. 3 Vertical blank
  35. ; h = Lev. 3 Copper
  36. ; i = Lev. 2 I/O Ports and timers
  37. ; j = Lev. 1 Software
  38. ; k = Lev. 1 Disk block finished
  39. ; l = Lev. 1 Serial port transmit buffer empty
  40.  
  41.     JumpPtr    Begin
  42.  
  43. *******************************************************************************
  44. **Macros
  45. *******************************************************************************
  46. WaitBlt:    MACRO
  47. .vent\@:    if    Raster=1
  48.     move.w    #$fff,Color00+_Custom
  49.     endif
  50.     btst    #14,Dmaconr+_Custom
  51.     bne.b    .vent\@
  52.     if    Raster=1
  53.     move.w    #0,Color00+_Custom
  54.     endif
  55.     ENDM
  56.  
  57. SetInt:    MACRO
  58.     move.l    (Lev\1Base).w,OldIrq\1
  59.     move.l    #Lev\1Irq,(Lev\1Base).w
  60.     bra.b    jumpo\@
  61. OldIrq\1:    dc.l    0
  62. jumpo\@:
  63.     ENDM
  64.  
  65. ClrInt:    MACRO
  66.     move.l    OldIrq\1(pc),(Lev\1Base).w
  67.     ENDM
  68.  
  69. Push.l:    MACRO
  70.     movem.l    \1,-(sp)
  71.     ENDM
  72.  
  73. Push.w:    MACRO
  74.     movem.w    \1,-(sp)
  75.     ENDM
  76.  
  77. Pull.l:    MACRO
  78.     movem.l    (sp)+,\1
  79.     ENDM
  80.  
  81. Pull.w:    MACRO
  82.     movem.w    (sp)+,\1
  83.     ENDM
  84.  
  85. StartPrg:    MACRO
  86.     move.w    #$7fff,Intreq+_Custom
  87.     move.w    #MyDmacon+$8000,Dmacon+_Custom
  88.     move.w    #MyIntena+$8000,Intena+_Custom
  89.     ENDM
  90.  
  91. StopPrg:    MACRO
  92.     move.w    #$7fff,Intena+_Custom
  93.     move.w    #$7fff,Dmacon+_Custom
  94.     move.w    #$7fff,Intreq+_Custom
  95.     ENDM
  96.  
  97. StopSystem:    MACRO
  98.     move.w    Intenar+_Custom,OldIntena
  99.     move.w    Dmaconr+_Custom,OldDmacon
  100.     StopPrg
  101.     bra.b    jumpo\@
  102. OldIntena:    dc.w    0
  103. OldDmacon:    dc.w    0
  104. jumpo\@:
  105.     ENDM
  106.  
  107. StartSystem:    MACRO
  108.     move.w    OldDmacon(pc),d0
  109.     or.w    #$8000,d0
  110.     move.w    d0,Dmacon+_Custom
  111.     move.w    OldIntena(pc),d0
  112.     or.w    #$8000,d0
  113.     move.w    d0,Intena+_Custom
  114.     ENDM
  115.  
  116. ClearBss:    MACRO
  117.     lea    _Bss1Start,a0
  118.     move.l    #(_Bss1End-_Bss1Start)/4,d0
  119. .clrloop\@    clr.l    (a0)+
  120.     subq.l    #1,d0
  121.     bne.b    .clrloop\@
  122.     ENDM
  123.  
  124.  
  125.  
  126.  
  127. *******************************************************************************
  128. **
  129. **  Initialisering
  130. **
  131. *******************************************************************************
  132.     SECTION    DenFedeKode,code
  133.  
  134. Begin:    IFEQ    Track-0
  135.     Push.l    d0-a6
  136.     StopSystem
  137.     ELSE
  138.     move.l    #Lev3Irq,$64.w
  139.     rts
  140.     ENDC
  141.  
  142. **Init starter -----------------------------------
  143.     ClearBss    1
  144.     ClearBss    2
  145.  
  146.     bsr    InitCodeBuffer
  147.     bsr    InitVerticalBuffer
  148.     bsr    InitInterpolBuffer
  149.     bsr    ComputeColors2
  150.     bsr    InitAGACopper
  151.     lea    ColorArray,a0
  152.     lea    AGA_Colors,a1
  153.     moveq    #0,d0
  154.     IFEQ    ECS-1
  155.     move.w    #31,d1
  156.     ELSE
  157.     move.w    #255,d1
  158.     ENDC
  159.     bsr    LoadAGACopper
  160.  
  161.     IFEQ    Track-0
  162.     SetInt    3
  163. **Init slutter -----------------------------------
  164.  
  165.     WaitBlt
  166.     StartPrg
  167.  
  168.  
  169.  
  170.  
  171. *******************************************************************************
  172. **
  173. **  Vent på exitsignal
  174. **
  175. *******************************************************************************
  176. WaitForExit:    tst.b    VBlank
  177.     beq.b    WaitForExit
  178.  
  179.     clr.b    VBlank
  180.     tst.b    IWantOut
  181.     bne.b    ExitToDos
  182.     bra.b    WaitForExit
  183.  
  184.  
  185.  
  186.  
  187. *******************************************************************************
  188. **
  189. **  Exit to AmigaDOS
  190. **
  191. *******************************************************************************
  192. ExitToDos:
  193.     StopPrg
  194.  
  195. **Exit starter -----------------------------------
  196.     ClrInt    3
  197. **Exit slutter -----------------------------------
  198.  
  199.     StartSystem
  200.  
  201.     Pull.l    d0-a6
  202.     moveq    #0,d0
  203.     ENDC
  204.     rts
  205.  
  206.  
  207.  
  208.  
  209. *******************************************************************************
  210. **
  211. **  Level 3 interrupt
  212. **
  213. *******************************************************************************
  214. Lev3Irq:    st    VBlank
  215.     push.l    d0-a6
  216. **Lev3irq starter --------------------------------
  217.     move.l    #Copper,Cop2lch+_Custom
  218.     move.w    d0,Copjmp2+_Custom
  219.  
  220.     lea    Routines(pc),a0
  221.     move.w    Status(pc),d0
  222.     add.w    d0,d0
  223.     add.w    d0,d0
  224.     move.l    (a0,d0.w),a0
  225.     jsr    (a0)
  226.  
  227. **Lev3irq slutter --------------------------------
  228.     IFEQ    Track-0
  229.     btst    #6,$bfe001
  230.     bne.b    .noleft
  231.     st    IWantOut
  232. .noleft    ENDC
  233.     IF    Raster=1
  234.     move.w    #$f00,Color00+_Custom
  235.     ENDIF
  236.     WaitBlt
  237.     IF    Raster=1
  238.     move.w    #$00f,Color00+_Custom
  239.     ENDIF
  240.     move.b    $dff005,d0
  241.     lsl.w    #8,d0
  242.     move.b    $dff006,d0
  243.     cmp.w    MaxRast,d0
  244.     blt.b    .ud
  245.     move.w    d0,MaxRast
  246. .ud:
  247.     pull.l    d0-a6
  248.     IFEQ    Track-0
  249.     move.w    #$0020,Intreq+_Custom
  250.     ELSE
  251.     move.w    #$0004,Intreq+_Custom
  252.     ENDC
  253.     rte
  254.  
  255. Status:    dc.w    0
  256. Routines:    dc.l    FadeUp,RingHandler,FadeDown
  257.  
  258. RingHandler:    bsr    SwapScr
  259.     bsr    MakeDezign
  260.     bsr    ClrScr
  261.     bsr    StoryBoard
  262.     cmp.w    #28000,ZCenter
  263.     bge.b    .none
  264.     bsr    Rotate
  265.     bsr    DrawFaces
  266. .none
  267.     cmp.w    #30000,ZCenter
  268.     bne.w    .out
  269.     st    IWantOut
  270. .out    rts
  271.  
  272. DezignPtr:    dc.w    0
  273. DezStat:    dc.w    0
  274. MakeDezign:    move.w    DezStat(pc),d0
  275.     beq.b    Dez_MakeIt
  276.     subq.w    #2,d0
  277.     beq.b    Dez_RemoveIt
  278.     rts
  279. Dez_MakeIt:    cmp.w    #8*21,DezignPtr
  280.     bne.b    .doit
  281.     addq.w    #1,DezStat
  282. .doit    lea    DezignJohn,a0
  283.     cmp.w    #$38,DezignPtr
  284.     ble.b    .ok
  285.     subq.w    #4,a0
  286. .ok    move.w    DezignPtr(pc),d0
  287.     lsl.w    #4,d0
  288.     sub.w    d0,a0
  289.     move.w    #$403,-10(a0)
  290.     addq.w    #1,DezignPtr
  291.     rts
  292. Dez_RemoveIt:    tst.w    DezignPtr
  293.     bgt.b    .doit
  294.     addq.w    #1,DezStat
  295.     rts
  296. .doit    subq.w    #1,DezignPtr
  297.     lea    DezignJohn,a0
  298.     cmp.w    #$38,DezignPtr
  299.     ble.b    .ok
  300.     subq.w    #4,a0
  301. .ok    move.w    DezignPtr(pc),d0
  302.     lsl.w    #4,d0
  303.     sub.w    d0,a0
  304.     move.w    #$103,-10(a0)
  305.     rts
  306.  
  307.  
  308. FadeUp:    move.l    #FadeCopper,Cop2lch+_Custom
  309.     move.w    d0,Copjmp2+_Custom
  310.  
  311.     move.w    FadeCopper|.col+2,d0
  312.     move.w    #$103,d1
  313.     bsr    fader
  314.     move.w    d0,FadeCopper|.col+2
  315.     cmp.w    #$103,d0
  316.     bne.b    .out
  317.     addq.w    #1,Status
  318. .out    rts
  319.     
  320. FadeDown:    move.l    #FadeCopper,Cop2lch+_Custom
  321.     move.w    d0,Copjmp2+_Custom
  322.  
  323.     move.w    FadeCopper|.col+2,d0
  324.     moveq    #0,d1
  325.     bsr    fader
  326.     move.w    d0,FadeCopper|.col+2
  327.     tst.w    d0
  328.     seq    IWantOut
  329.     rts
  330.     
  331.  
  332.  
  333.  
  334. **d0=fade from
  335. **d1=fade to
  336. **out: d0=newcol
  337. fader:    move.w    d0,d2
  338.     move.w    d1,d3
  339.     lsr.w    #8,d2
  340.     lsr.w    #8,d3
  341.     cmp.w    d2,d3
  342.     beq.b    .nored
  343.     blt.b    .redsub
  344.     add.w    #$100,d0
  345.     bra.b    .nored
  346. .redsub:    sub.w    #$100,d0
  347. .nored:    move.w    d0,d2
  348.     move.w    d1,d3
  349.     lsr.w    #4,d2
  350.     lsr.w    #4,d3
  351.     and.w    #$f,d2
  352.     and.w    #$f,d3
  353.     cmp.w    d2,d3
  354.     beq.b    .nogreen
  355.     blt.b    .greensub
  356.     add.w    #$10,d0
  357.     bra.b    .nogreen
  358. .greensub:    sub.w    #$10,d0
  359. .nogreen:    move.w    d0,d2
  360.     move.w    d1,d3
  361.     and.w    #$f,d2
  362.     and.w    #$f,d3
  363.     cmp.w    d2,d3
  364.     beq.b    .noblue
  365.     blt.b    .bluesub
  366.     addq.w    #$1,d0
  367.     bra.b    .noblue
  368. .bluesub:    subq.w    #$1,d0
  369. .noblue:    rts
  370.  
  371.  
  372. *******************************************************************************
  373. **
  374. **  Storyboard
  375. **
  376. *******************************************************************************
  377. StoryBoard:    move.w    Story,d0
  378.     beq.b    Story_00
  379.     subq.w    #1,d0
  380.     beq.b    Story_01
  381.     subq.w    #1,d0
  382.     beq.w    Story_02
  383.     subq.w    #1,d0
  384.     beq.w    Story_03
  385.     subq.w    #1,d0
  386.     beq.w    Story_04
  387.     rts
  388.  
  389. Story_00:    sub.w    #100,XCenter
  390.     beq.b    .out
  391.     rts
  392. .out    clr.w    YAdd
  393.     addq.w    #1,Story
  394.     move.w    #3000,StoryData3
  395.     rts
  396.  
  397. Story_01:    lea    Story_01_Sine,a0
  398.     move.w    StoryData1,d0
  399.     add.w    d0,d0
  400.     move.w    (a0,d0.w),d0
  401.     muls    StoryData3,d0
  402.     divs    #3000,d0
  403.     move.w    d0,d7
  404.     move.w    d0,d1
  405.     sub.w    StoryData2,d0
  406.     move.w    d1,StoryData2
  407.     sub.w    d0,Coords+0*6
  408.     sub.w    d0,Coords+1*6
  409.     sub.w    d0,Coords+4*6
  410.     sub.w    d0,Coords+5*6
  411.     addq.w    #1,StoryData1
  412.     and.w    #32-1,StoryData1
  413.  
  414.     asr.w    #2,d7
  415.     neg.w    d7
  416.     add.w    d7,d7
  417.     move.w    d7,YAngle2
  418.     and.w    #2048-1,YAngle2
  419.  
  420.     sub.w    #30,StoryData3
  421.     bge.b    .out
  422.     addq.w    #1,Story
  423.     clr.w    StoryData1
  424.     move.w    #256*2,StoryData2
  425. .out    rts
  426.  
  427. Story_02:    lea    XAdd,a0
  428.     cmp.w    #6,(a0)+
  429.     beq.b    .xok
  430.     addq.w    #2,-2(a0)
  431. .xok    cmp.w    #-2,(a0)+
  432.     beq.b    .yok
  433.     subq.w    #2,-2(a0)
  434. .yok    cmp.w    #6,(a0)+
  435.     beq.b    .zok
  436.     addq.w    #2,-2(a0)
  437.     rts
  438. .zok    addq.w    #1,Story
  439.     move.w    #25*50,StoryPause
  440.     rts
  441.  
  442. Story_03:    bsr    TransformObj
  443.     subq.w    #1,StoryPause
  444.     bne.b    .ok
  445.     addq.w    #1,Story
  446.     addq.w    #1,DezStat
  447. .ok    rts
  448.  
  449. Story_04:    lea    SinTable,a0
  450.     move.w    StoryData1,d1
  451.     move.w    StoryData2,d2
  452.     move.w    StoryData3,d3
  453.  
  454.     add.w    #100,ZCenter
  455.  
  456.     move.w    (a0,d2.w),d2
  457.     muls    #3500,d2
  458.     asr.l    #8,d2
  459.     asr.l    #6,d2
  460.     move.w    ZCenter,d3
  461.     sub.w    #6000,d3
  462.     muls    d3,d2
  463.     divs    #12000,d2
  464.     move.w    d2,YCenter
  465.  
  466.     move.w    (a0,d1.w),d1
  467.     muls    #3500,d1
  468.     asr.l    #8,d1
  469.     asr.l    #6,d1
  470.     move.w    ZCenter,d3
  471.     sub.w    #6000,d3
  472.     muls    d3,d1
  473.     divs    #12000,d1
  474.     move.w    d1,XCenter
  475.  
  476.     lea    StoryData1,a0
  477.     add.w    #32,(a0)
  478.     and.w    #2048-1,(a0)+
  479.     add.w    #32,(a0)
  480.     and.w    #2048-1,(a0)+
  481.     addq.w    #4,(a0)
  482.     and.w    #2048-1,(a0)+
  483.     bsr    TransformObj
  484.     rts
  485.  
  486. StoryData1:    dc.w    0
  487. StoryData2:    dc.w    0
  488. StoryData3:    dc.w    0
  489. StoryPause:    dc.w    0
  490.  
  491. *******************************************************************************
  492. **
  493. **  Compute some colors
  494. **
  495. *******************************************************************************
  496. ComputeColors2:    lea    .colors+4,a0
  497.     move.l    #$00404b,d0
  498.     move.l    #$00c8b4,d1
  499.     moveq    #0,d6
  500.     IFEQ    ECS-1
  501.     moveq    #4,d7
  502.     ELSE
  503.     moveq    #7,d7
  504.     ENDC
  505. .makecols    bsr    FadeAGA
  506.     move.l    d2,(a0)+
  507.     addq.w    #1,d6
  508.     IFEQ    ECS-1
  509.     cmp.w    #5,d6
  510.     ELSE
  511.     cmp.w    #8,d6
  512.     ENDC
  513.     bne.b    .makecols
  514.     lea    ColorArray,a0
  515.     moveq    #0,d0
  516. .exanext    moveq    #7,d1
  517.     moveq    #0,d2
  518. .testigen    btst    d1,d0
  519.     beq.b    .a_zero
  520.     addq.w    #1,d2
  521. .a_zero    dbra    d1,.testigen
  522.     add.w    d2,d2
  523.     add.w    d2,d2
  524.     move.l    .colors(PC,d2.w),d2
  525.     move.l    d2,(a0)+
  526.     addq.w    #1,d0
  527.     IFEQ    ECS-1
  528.     cmp.w    #32,d0
  529.     ELSE
  530.     cmp.w    #256,d0
  531.     ENDC
  532.     bne.b    .exanext
  533.     rts
  534. .colors    dc.l    $110033
  535.     IFEQ    ECS-1
  536.     blk.l    5,0
  537.     ELSE
  538.     blk.l    8,0
  539.     ENDC
  540.  
  541.  
  542.  
  543.  
  544. *******************************************************************************
  545. **
  546. **  Fade 24bit colors
  547. **
  548. **  input:
  549. **  d0.l=source color
  550. **  d1.l=dest color
  551. **  d6.w=step
  552. **  d7.w=last step
  553. **
  554. **  output:
  555. **  d2.l=new color
  556. **
  557. **  trashed regs:
  558. **  d0-d6
  559. **
  560. *******************************************************************************
  561. FadeAGA:    move.l    d0,d2
  562.     move.l    d1,d3
  563.     swap    d2
  564.     swap    d3
  565.     sub.w    d2,d3
  566.     muls    d6,d3
  567.     divs    d7,d3
  568.     add.w    d2,d3
  569.     swap    d3
  570.     clr.w    d3        ;R
  571.     move.l    d0,d2
  572.     move.l    d1,d4
  573.     and.w    #$ff00,d2
  574.     and.w    #$ff00,d4
  575.     sub.w    d2,d4
  576.     lsr.w    #8,d4
  577.     muls    d6,d4
  578.     divs    d7,d4
  579.     lsl.w    #8,d4
  580.     add.w    d2,d4
  581.     and.l    #$00ff00,d4    ;G
  582.     move.w    d0,d5
  583.     move.w    d1,d2
  584.     and.w    #$00ff,d5
  585.     and.w    #$00ff,d2
  586.     sub.w    d5,d2
  587.     muls    d6,d2
  588.     divs    d7,d2
  589.     add.w    d5,d2
  590.     and.l    #$0000ff,d2    ;B
  591.     or.l    d3,d2
  592.     or.l    d4,d2    ;color
  593.     rts
  594.  
  595.  
  596.  
  597.  
  598.  
  599. *******************************************************************************
  600. **
  601. **  Load AGA copper with colors
  602. **
  603. **  input:
  604. **  a0.l=24bit color array (00000000RRRRRRRRGGGGGGGGBBBBBBBB per color)
  605. **  a1.l=initialized aga copper array
  606. **  d0.w=start color
  607. **  d1.w=end color
  608. **
  609. *******************************************************************************
  610. LoadAGACopper:
  611.     IFEQ    ECS-0
  612.     moveq    #0,d2    ;color index to current bank
  613.     sub.w    d0,d1    ;number of colors to load
  614.     move.w    d1,d7    ;color countdown
  615.     move.w    d0,d6
  616.     beq.b    .noskip
  617.     add.w    d0,d0
  618.     add.w    d0,d0
  619.     add.w    d0,a0    ;skip first colors
  620.     move.w    d6,d0
  621.     lsr.w    #5,d0
  622.     mulu    #33*2*4,d0
  623.     add.w    d0,a1    ;skip first banks
  624.     and.w    #$1f,d6
  625. .noskip    addq.w    #4,a1
  626.     clr.w    -(sp)
  627.     lea    33*4(a1),a2    ;lower nibbles
  628. .next    move.l    (a0)+,d0
  629.     move.l    d0,d3
  630.     move.w    d0,d1
  631.     move.l    d0,d2
  632.     and.w    #$000f,d0
  633.     and.w    #$0f00,d1
  634.     lsr.w    #4,d1
  635.     swap    d2
  636.     and.w    #$f,d2
  637.     lsl.w    #8,d2
  638.     or.w    d2,d1
  639.     or.w    d1,d0
  640.     move.w    d0,2(a2)
  641.     move.l    d3,d0
  642.     move.w    d0,d1
  643.     move.l    d0,d2
  644.     and.w    #$f0,d0
  645.     lsr.w    #4,d0
  646.     move.w    d1,(sp)
  647.     move.b    (sp),d1
  648.     and.w    #$00f0,d1
  649.     swap    d2
  650.     and.w    #$00f0,d2
  651.     lsl.w    #4,d2
  652.     or.w    d2,d1
  653.     or.w    d1,d0
  654.     move.w    d0,2(a1)
  655.     addq.w    #4,a1
  656.     addq.w    #4,a2
  657.     subq.w    #1,d7
  658.     blt.b    .out
  659.     addq.w    #1,d6
  660.     cmp.w    #$20,d6
  661.     bne.b    .next
  662.     lea    34*4(a1),a1
  663.     lea    34*4(a2),a2
  664.     moveq    #0,d6
  665.     bra.b    .next
  666. .out    clr.w    (sp)+
  667.     rts
  668.     ELSE
  669.     sub.w    d0,d1
  670.     add.w    d0,d0
  671.     add.w    d0,d0
  672.     lea    2(a1,d0.w),a1
  673. .loop    move.l    (a0)+,d2
  674.     move.l    d2,d3
  675.     move.l    d2,d4
  676.     swap    d4
  677.     lsl.w    #4,d4
  678.     and.w    #$f00,d4
  679.     lsr.w    #8,d3
  680.     and.w    #$0f0,d3
  681.     lsr.w    #4,d2
  682.     and.w    #$00f,d2
  683.     or.w    d2,d3
  684.     or.w    d3,d4
  685.     move.w    d4,(a1)
  686.     addq.w    #4,a1
  687.     dbra    d1,.loop
  688.     rts
  689.     ENDC
  690.  
  691.  
  692.  
  693.  
  694. *******************************************************************************
  695. **
  696. **  Init AGA copper-array
  697. **
  698. *******************************************************************************
  699. InitAGACopper:    lea    AGA_Colors,a0
  700.     IFEQ    ECS-0
  701.     move.l    #Bplcon3<<16!$0c40,d0
  702.     move.l    #Bplcon3<<16!$0e40,d1
  703.     moveq    #8-1,d7
  704. .loop    move.l    d0,(a0)+
  705.     bsr    .fillit
  706.     move.l    d1,(a0)+
  707.     bsr    .fillit
  708.     add.w    #$2000,d0
  709.     add.w    #$2000,d1
  710.     dbra    d7,.loop
  711.     rts
  712.     ENDC
  713. .fillit    move.w    #Color00,d2
  714.     moveq    #32-1,d6
  715. .fillloop    move.w    d2,(a0)+
  716.     clr.w    (a0)+
  717.     addq.w    #2,d2
  718.     dbra    d6,.fillloop
  719.     rts
  720.  
  721. *******************************************************************************
  722. **
  723. **  Draw a dotted line
  724. **
  725. **  input:
  726. **    d0-d3: coords
  727. **
  728. *******************************************************************************
  729. DrawLine:    MACRO
  730.     cmp.w    d0,d2
  731.     bge.b    .ok\@
  732.     exg    d0,d2
  733.     exg    d1,d3
  734. .ok\@    move.w    d0,d5
  735.     move.w    d1,d6
  736.  
  737.     lea    VerticalMulsTab,a1
  738.     sub.w    d1,d3
  739.     add.w    #256,d3
  740.     add.w    d3,d3
  741.     add.w    d3,d3
  742.     move.l    (a1,d3.w),a1
  743.  
  744.     lea    CodeMulsTab,a2
  745.     sub.w    d0,d2
  746.     lsl.w    #3,d2
  747.     and.w    #$7,d0
  748.     add.w    d0,d2
  749.     add.w    d2,d2
  750.     add.w    d2,d2
  751.     move.l    (a2,d2.w),a2
  752.  
  753.     lsl.w    #4,d6
  754.     move.w    d6,d7
  755.     lsl.w    #2,d7
  756.     add.w    d7,d6
  757.     asr.w    #3,d5
  758.     add.w    d5,d6
  759.     move.l    Screen_Draw,a0
  760.     lea    (a0,d6.w),a0
  761.     moveq    #0,d0
  762.     moveq    #1,d1
  763.     moveq    #2,d2
  764.     moveq    #3,d3
  765.     moveq    #4,d4
  766.     moveq    #5,d5
  767.     moveq    #6,d6
  768.     moveq    #7,d7
  769.     jsr    (a2)
  770.     ENDM
  771.  
  772.  
  773.  
  774.  
  775. *******************************************************************************
  776. **
  777. **  Prøv lidt rotation
  778. **
  779. *******************************************************************************
  780. Rotate:    lea    Coords,a0
  781.     lea    PerspCoords,a1
  782.     lea    CosTable,a2
  783.     lea    SinTable,a3
  784.     lea    Angles,a4
  785.     lea    XCenter,a5
  786.     sub.w    a6,a6
  787.  
  788. .nextkoord    cmp.w    #$8000,(a0)
  789.     beq.w    .out
  790.  
  791.     move.w    (a0)+,d0
  792. .RotXY:    move.w    (a0)+,d1    ;d0=Xp , d1=Yp & d2=Vinkel
  793.     move    (a4),d2
  794.     move    (a2,d2.w),d3
  795.     move    (a3,d2.w),d4
  796.     move    d0,d7
  797.     move    d1,d6
  798.     muls    d3,d0
  799.     muls    d4,d1
  800.     muls    d4,d7
  801.     muls    d3,d6
  802.     sub.l    d1,d0
  803.     add.l    d6,d7
  804.     lsl.l    #2,d0
  805.     lsl.l    #2,d7
  806.     swap    d0        ;X
  807.     swap    d7        ;Y
  808. .RotXZ:    move    (a0)+,d1    ;d0=Xp , d1=Zp & d2=Vinkel
  809.     move    2(a4),d2
  810.     move.w    a6,d3
  811.     btst    #1,d3
  812.     bne.b    .nope
  813.     move.w    YAngle2,d2
  814. .nope    move    (a2,d2.w),d3
  815.     move    (a3,d2.w),d4
  816.     move    d0,d5
  817.     move    d1,d6
  818.     muls    d3,d0
  819.     muls    d4,d1
  820.     muls    d4,d5
  821.     muls    d3,d6
  822.     sub.l    d1,d0
  823.     add.l    d6,d5
  824.     lsl.l    #2,d0
  825.     lsl.l    #2,d5
  826.     swap    d0        ;X
  827.     swap    d5        ;Z
  828. .RotYZ:    move    4(a4),d2    ;d7=Yp , d5=Zp & d2=Vinkel
  829.     move    (a2,d2.w),d3
  830.     move    (a3,d2.w),d4
  831.     move    d7,d1
  832.     move    d5,d6
  833.     muls    d3,d7
  834.     muls    d4,d5
  835.     muls    d4,d1
  836.     muls    d3,d6
  837.     sub.l    d5,d7
  838.     add.l    d6,d1
  839.     lsl.l    #2,d7
  840.     lsl.l    #2,d1
  841.     swap    d7        ;Y
  842.     swap    d1        ;Z
  843. .MakePer:    add.w    4(a5),d1    ;Z
  844.     add.w    (a5),d0
  845.     add.w    2(a5),d7
  846.     ext.l    d0
  847.     ext.l    d7
  848.     lsl.l    #8,d0
  849.     lsl.l    #8,d7
  850.     divs    d1,d0
  851.     divs    d1,d7
  852.     add    #320/2,d0
  853.     add    #256/2,d7
  854. .GemCor:    move    d0,(a1)+
  855.     move    d7,(a1)+
  856.     addq.w    #1,a6
  857.     bra.w    .nextkoord
  858. .Out:    lea    XAdd,a1
  859.     lea    Angles,a0
  860.     move.w    (a1)+,d0
  861.     add.w    d0,(a0)
  862.     and.w    #2048-1,(a0)+
  863.     move.w    (a1)+,d0
  864.     add.w    d0,(a0)
  865.     and.w    #2048-1,(a0)+
  866.     move.w    (a1)+,d0
  867.     add.w    d0,(a0)
  868.     and.w    #2048-1,(a0)+
  869.     cmp.w    #1,Story
  870.     beq.b    .heltiskoven
  871.     move.w    Angles+2,YAngle2
  872. .heltiskoven    rts
  873.  
  874.  
  875.  
  876.  
  877. *******************************************************************************
  878. **
  879. **  Clear screen using blitter
  880. **
  881. *******************************************************************************
  882. ClrScr:    lea    _Custom,a6
  883.     WaitBlt
  884.     move.l    Screen_Clear,Bltdpth(a6)
  885.     move.l    #$01000000,Bltcon0(a6)
  886.     move.w    #40,Bltdmod(a6)
  887.     move.w    #256<<6!20,Bltsize(a6)
  888.     rts
  889.  
  890.  
  891.  
  892.  
  893. *******************************************************************************
  894. **
  895. **  Swap screen for doublebuffering!
  896. **
  897. *******************************************************************************
  898. SwapScr:    IFEQ    ECS-1
  899.     lea    Screen_Clear+7*4,a0
  900.     ELSE
  901.     lea    Screen_Clear+10*4,a0
  902.     ENDC
  903.     lea    -4(a0),a1
  904.     move.l    (a1),d7
  905.     IFEQ    ECS-1
  906.     moveq    #6-1,d6
  907.     ELSE
  908.     moveq    #9-1,d6
  909.     ENDC
  910. .cloop    move.l    -(a1),-(a0)
  911.     dbra    d6,.cloop
  912.     move.l    d7,(a1)
  913.  
  914.     lea    Copper_PlanePtr+2,a3
  915.     lea    Screen_Show,a0
  916.     IFEQ    ECS-1
  917.     moveq    #5-1,d7
  918.     ELSE
  919.     moveq    #8-1,d7
  920.     ENDC
  921. .loop    move.l    (a0)+,d0
  922.     move.w    d0,4(a3)
  923.     swap    d0
  924.     move.w    d0,(a3)
  925.     addq.w    #8,a3
  926.     dbra    d7,.loop
  927.     rts
  928.  
  929.  
  930.  
  931.  
  932. *******************************************************************************
  933. **
  934. **  Initialiser InterpolBuffer
  935. **
  936. *******************************************************************************
  937. InitInterpolBuffer:
  938.     lea    InterpolBuffer,a6
  939.     move.w    #-320,d0    ;size
  940. .nextsize    moveq    #MatrixSize-1,d1    ;trinnummer
  941. .loop    move.w    d0,d2
  942.     muls    d1,d2
  943.     divs    #MatrixSize-1,d2    ;linjenummer
  944.     move.w    d2,(a6)+
  945.     IFEQ    Track-0
  946.     move.w    a6,$dff180
  947.     ENDC
  948.     dbra    d1,.loop
  949.     addq.w    #1,d0
  950.     cmp.w    #319,d0
  951.     ble.b    .nextsize
  952.     rts
  953.  
  954.  
  955.  
  956.  
  957. *******************************************************************************
  958. **
  959. **  Initialiser VerticalBuffer
  960. **
  961. *******************************************************************************
  962. InitVerticalBuffer:
  963.     lea    VerticalBuffer,a6
  964.     lea    VerticalMulsTab,a5
  965.     move.w    #-256,d0    ;size
  966. .nextsize    moveq    #MatrixSize-1,d1    ;trinnummer
  967.     move.l    a6,(a5)+
  968. .loop    move.w    d0,d2
  969.     muls    d1,d2
  970.     divs    #MatrixSize-1,d2    ;linjenummer
  971.     muls    #80,d2
  972.     move.w    d2,(a6)+
  973.     IFEQ    Track-0
  974.     move.w    a6,$dff180
  975.     ENDC
  976.     dbra    d1,.loop
  977.     addq.w    #1,d0
  978.     cmp.w    #255,d0
  979.     ble.b    .nextsize
  980.     rts
  981.  
  982.  
  983.  
  984.  
  985. *******************************************************************************
  986. **
  987. **  Initialiser CodeBuffer
  988. **
  989. *******************************************************************************
  990. InitCodeBuffer:    lea    DotInstructions(pc),a0
  991.     lea    CodeBuffer,a6
  992.     lea    CodeMulsTab,a5
  993.     moveq    #0,d0    ;startpixel
  994.     moveq    #0,d1    ;stoppixel
  995. .nextsize    moveq    #8-1,d5    ;bits per byte
  996. .nextbit    move.l    a6,(a5)+
  997.     moveq    #MatrixSize-1,d2    ;trinnummer
  998. .loop    move.w    d1,d3
  999.     sub.w    d0,d3
  1000.     mulu    d2,d3
  1001.     divu    #MatrixSize-1,d3
  1002.     add.w    d0,d3    ;pixelnummer
  1003.     move.w    d3,d4
  1004.     lsr.w    #3,d3
  1005.     and.w    #$7,d4
  1006.     add.w    d4,d4
  1007.     add.w    d4,d4
  1008.     move.w    (a0),(a6)+
  1009.     move.w    2(a0,d4.w),(a6)+
  1010.     move.b    4(a0,d4.w),(a6)+
  1011.     move.b    d3,(a6)+
  1012.     dbra    d2,.loop
  1013.     move.w    RtsCode(pc),(a6)+
  1014.     IFEQ    Track-0
  1015.     move.w    a6,$dff180
  1016.     ENDC
  1017.     addq.w    #1,d0
  1018.     addq.w    #1,d1
  1019.     dbra    d5,.nextbit
  1020.     subq.w    #8,d0
  1021.     subq.w    #7,d1
  1022.     cmp.w    #319,d1
  1023.     ble.b    .nextsize
  1024.     rts
  1025.  
  1026. DotInstructions:    move.w    (a1)+,a2        ;8
  1027.     bset    d7,$0(a0,a2.w)    ;18
  1028. BytesPerDot:    EQU    *-DotInstructions
  1029.     bset    d6,$0(a0,a2.w)
  1030.     bset    d5,$0(a0,a2.w)
  1031.     bset    d4,$0(a0,a2.w)
  1032.     bset    d3,$0(a0,a2.w)
  1033.     bset    d2,$0(a0,a2.w)
  1034.     bset    d1,$0(a0,a2.w)
  1035.     bset    d0,$0(a0,a2.w)
  1036. RtsCode:    rts
  1037.  
  1038.  
  1039.  
  1040.  
  1041. DrawFaces:    lea    PerspCoords,a0
  1042.     lea    Faces,a1
  1043.  
  1044.     moveq    #0,d6
  1045.     moveq    #0,d7
  1046.     move.b    (a1)+,d6
  1047.     add.w    d6,d6
  1048.     add.w    d6,d6
  1049.     move.b    (a1)+,d7
  1050.     add.w    d7,d7
  1051.     add.w    d7,d7
  1052.     move.w    (a0,d6.w),d0
  1053.     move.w    2(a0,d6.w),d1
  1054.     move.w    (a0,d7.w),d2
  1055.     move.w    2(a0,d7.w),d3
  1056.     lea    SideBuffer1,a2
  1057.     bsr    .interpol
  1058.  
  1059.     moveq    #0,d6
  1060.     moveq    #0,d7
  1061.     move.b    (a1)+,d6
  1062.     add.w    d6,d6
  1063.     add.w    d6,d6
  1064.     move.b    (a1)+,d7
  1065.     add.w    d7,d7
  1066.     add.w    d7,d7
  1067.     move.w    (a0,d6.w),d0
  1068.     move.w    2(a0,d6.w),d1
  1069.     move.w    (a0,d7.w),d2
  1070.     move.w    2(a0,d7.w),d3
  1071.     lea    SideBuffer2,a2
  1072.     bsr    .interpol
  1073.  
  1074.     lea    FaceBuffer1,a2
  1075.     lea    SideBuffer1,a3
  1076.     lea    SideBuffer2,a4
  1077.     REPT    MatrixSize
  1078.     move.w    (a3)+,d0
  1079.     move.w    (a3)+,d1
  1080.     move.w    (a4)+,d2
  1081.     move.w    (a4)+,d3
  1082.     push.l    a3/a4
  1083.     bsr    .interpol
  1084.     pull.l    a3/a4
  1085.     ENDR
  1086.  
  1087.  
  1088.     moveq    #0,d6
  1089.     moveq    #0,d7
  1090.     move.b    (a1)+,d6
  1091.     add.w    d6,d6
  1092.     add.w    d6,d6
  1093.     move.b    (a1)+,d7
  1094.     add.w    d7,d7
  1095.     add.w    d7,d7
  1096.     move.w    (a0,d6.w),d0
  1097.     move.w    2(a0,d6.w),d1
  1098.     move.w    (a0,d7.w),d2
  1099.     move.w    2(a0,d7.w),d3
  1100.     lea    SideBuffer1,a2
  1101.     bsr    .interpol
  1102.  
  1103.     moveq    #0,d6
  1104.     moveq    #0,d7
  1105.     move.b    (a1)+,d6
  1106.     add.w    d6,d6
  1107.     add.w    d6,d6
  1108.     move.b    (a1)+,d7
  1109.     add.w    d7,d7
  1110.     add.w    d7,d7
  1111.     move.w    (a0,d6.w),d0
  1112.     move.w    2(a0,d6.w),d1
  1113.     move.w    (a0,d7.w),d2
  1114.     move.w    2(a0,d7.w),d3
  1115.     lea    SideBuffer2,a2
  1116.     bsr    .interpol
  1117.  
  1118.     lea    FaceBuffer2,a2
  1119.     lea    SideBuffer1,a3
  1120.     lea    SideBuffer2,a4
  1121.     REPT    MatrixSize
  1122.     move.w    (a3)+,d0
  1123.     move.w    (a3)+,d1
  1124.     move.w    (a4)+,d2
  1125.     move.w    (a4)+,d3
  1126.     push.l    a3/a4
  1127.     bsr    .interpol
  1128.     pull.l    a3/a4
  1129.     ENDR
  1130.  
  1131.  
  1132.  
  1133.     lea    FaceBuffer1,a5
  1134.     lea    FaceBuffer2,a6
  1135.     REPT    MatrixSize*MatrixSize
  1136.     move.w    (a5)+,d0
  1137.     move.w    (a5)+,d1
  1138.     move.w    (a6)+,d2
  1139.     move.w    (a6)+,d3
  1140.     DrawLine
  1141.     ENDR
  1142.  
  1143.     rts
  1144.  
  1145. .interpol    lea    InterpolBuffer,a3
  1146.     sub.w    d0,d2
  1147.     sub.w    d1,d3
  1148.     add.w    #320,d2
  1149.     add.w    #320,d3
  1150.     muls    #MatrixSize*2,d2
  1151.     muls    #MatrixSize*2,d3
  1152.     lea    (a3,d2.w),a4
  1153.     lea    (a3,d3.w),a5
  1154.     REPT    MatrixSize
  1155.     move.w    (a4)+,d5
  1156.     add.w    d0,d5
  1157.     move.w    d5,(a2)+
  1158.     move.w    (a5)+,d5
  1159.     add.w    d1,d5
  1160.     move.w    d5,(a2)+
  1161.     ENDR
  1162.     rts
  1163.  
  1164.  
  1165.  
  1166. TransformObj:    tst.w    TransPause
  1167.     bne.b    .pause
  1168.     move.l    TransPointer,a0
  1169.     lea    Coords,a1
  1170.     moveq    #0,d6
  1171.     moveq    #3*8-1,d7
  1172. .loop    move.w    (a0)+,d0
  1173.     sub.w    (a1),d0
  1174.     beq.b    .nothing
  1175.     bpl.b    .plus
  1176.     sub.w    #50,(a1)+
  1177.     bra.b    .donext
  1178. .plus    add.w    #50,(a1)+
  1179.     bra.b    .donext
  1180. .nothing    addq.w    #1,d6
  1181.     addq.w    #2,a1
  1182. .donext    dbra    d7,.loop
  1183.     cmp.w    #3*8,d6
  1184.     bne.b    .out
  1185.     cmp.w    #$8000,(a0)
  1186.     bne.b    .noend
  1187.     lea    TransObjects,a0
  1188. .noend    move.l    a0,TransPointer
  1189.     move.w    #50*3,TransPause
  1190. .out    rts
  1191. .pause    subq.w    #1,TransPause
  1192.     rts
  1193.  
  1194.  
  1195.  
  1196. *******************************************************************************
  1197. **
  1198. **  Variable
  1199. **
  1200. *******************************************************************************
  1201.     SECTION    SjovData,data
  1202.  
  1203. Faces:    dc.b    0,1,3,2
  1204.     dc.b    4,5,7,6
  1205.  
  1206. Coords:    dc.w    -1500,-1500,-1500    ;0
  1207.     dc.w    1500,-1500,-1500    ;1
  1208.     dc.w    1500,1500,-1500    ;2
  1209.     dc.w    -1500,1500,-1500    ;3
  1210.     dc.w    -1500,-1500,1500    ;4
  1211.     dc.w    1500,-1500,1500    ;5
  1212.     dc.w    1500,1500,1500    ;6
  1213.     dc.w    -1500,1500,1500    ;7
  1214.     dc.w    $8000
  1215.  
  1216. TransObjects:    dc.w    -1500,-1500,-1500    ;0
  1217.     dc.w    1500,-1500,-1500    ;1
  1218.     dc.w    1500,1500,-1500    ;2
  1219.     dc.w    -1500,1500,-1500    ;3
  1220.     dc.w    -1500,-1500,1500    ;4
  1221.     dc.w    1500,-1500,1500    ;5
  1222.     dc.w    1500,1500,1500    ;6
  1223.     dc.w    -1500,1500,1500    ;7
  1224.  
  1225.     dc.w    1500,-1500,-1500    ;1
  1226.     dc.w    1500,1500,-1500    ;2
  1227.     dc.w    -1500,1500,-1500    ;3
  1228.     dc.w    -1500,-1500,-1500    ;0
  1229.     dc.w    -1500,-1500,1500    ;4
  1230.     dc.w    1500,-1500,1500    ;5
  1231.     dc.w    1500,1500,1500    ;6
  1232.     dc.w    -1500,1500,1500    ;7
  1233.  
  1234.     dc.w    -0,-1500,-1500    ;0
  1235.     dc.w    1500,-1500,1500    ;1
  1236.     dc.w    0,1500,-1500    ;2
  1237.     dc.w    -1500,1500,1500    ;3
  1238.     dc.w    -0,-1500,1500    ;4
  1239.     dc.w    1500,-1500,-1500    ;5
  1240.     dc.w    0,1500,1500    ;6
  1241.     dc.w    -1500,1500,-1500    ;7
  1242.  
  1243.     dc.w    1500,1500,-1500    ;2
  1244.     dc.w    -1500,1500,-1500    ;3
  1245.     dc.w    -1500,-1500,-1500    ;0
  1246.     dc.w    1500,-1500,-1500    ;1
  1247.     dc.w    -1500,-1500,1500    ;4
  1248.     dc.w    1500,-1500,1500    ;5
  1249.     dc.w    1500,1500,1500    ;6
  1250.     dc.w    -1500,1500,1500    ;7
  1251.  
  1252.     dc.w    0,0,0        ;0
  1253.     dc.w    1500,-1500,-1500    ;1
  1254.     dc.w    1500,1500,-1500    ;2
  1255.     dc.w    -1500,1500,-1500    ;3
  1256.     dc.w    -1500,-1500,1500    ;4
  1257.     dc.w    1500,-1500,1500    ;5
  1258.     dc.w    0,0,0    ;6
  1259.     dc.w    -1500,1500,1500    ;7
  1260.  
  1261.     dc.w    1500,1500,1500    ;6
  1262.     dc.w    1500,-1500,-1500    ;1
  1263.     dc.w    1500,1500,-1500    ;2
  1264.     dc.w    -1500,1500,-1500    ;3
  1265.     dc.w    -1500,-1500,1500    ;4
  1266.     dc.w    1500,-1500,1500    ;5
  1267.     dc.w    -1500,-1500,-1500    ;0
  1268.     dc.w    -1500,1500,1500    ;7
  1269.  
  1270.     dc.w    $8000
  1271.  
  1272. TransPointer:    dc.l    TransObjects
  1273.  
  1274. Screen_Clear:    dc.l    Screen1
  1275. Screen_Draw:    dc.l    Screen2
  1276. Screen_Show:    dc.l    Screen3
  1277.     dc.l    Screen4
  1278.     dc.l    Screen5
  1279.     dc.l    Screen6
  1280.     dc.l    Screen7
  1281.     IFEQ    ECS-0
  1282.     dc.l    Screen8
  1283.     dc.l    Screen9
  1284.     dc.l    Screen10
  1285.     ENDC
  1286.  
  1287. XCenter:    dc.w    6300
  1288. YCenter:    dc.w    0
  1289. ZCenter:    dc.w    6000
  1290.  
  1291. XAdd:    dc.w    0
  1292. YAdd:    dc.w    -20
  1293. ZAdd:    dc.w    0
  1294.  
  1295. Angles:    dc.w    0
  1296.     dc.w    (62*20)&2047
  1297.     dc.w    0
  1298. YAngle2:    dc.w    0
  1299.  
  1300. Story_01_Sine:    ;    0,360,32,1300,0,w,1,y,n
  1301.     DC.W    $007F,$0179,$0264,$0338,$03EC,$047A,$04DC,$050D,$050D,$04DC
  1302.     DC.W    $047A,$03EC,$0338,$0264,$0179,$007F,$FF81,$FE87,$FD9C,$FCC8
  1303.     DC.W    $FC14,$FB86,$FB24,$FAF3,$FAF3,$FB24,$FB86,$FC14,$FCC8,$FD9C
  1304.     DC.W    $FE87,$FF81
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310. ;Option nº  = 1
  1311. ;Min. y-val = -1.63840E+04
  1312. ;Max. y-val =  1.63840E+04
  1313. ;Startvalue = min
  1314. ;Length     = 1024
  1315. SinTable:    dc.w    0,101,201,302,402,503,603,704,804,904,1005,1105,1205,1306,1406,1506
  1316.     dc.w    1606,1706,1806,1906,2006,2105,2205,2305,2404,2503,2603,2702,2801,2900,2999,3098
  1317.     dc.w    3196,3295,3393,3492,3590,3688,3786,3883,3981,4078,4176,4273,4370,4467,4563,4660
  1318.     dc.w    4756,4852,4948,5044,5139,5235,5330,5425,5520,5614,5708,5803,5897,5990,6084,6177
  1319.     dc.w    6270,6363,6455,6547,6639,6731,6823,6914,7005,7096,7186,7276,7366,7456,7545,7635
  1320.     dc.w    7723,7812,7900,7988,8076,8163,8250,8337,8423,8509,8595,8680,8765,8850,8935,9019
  1321.     dc.w    9102,9186,9269,9352,9434,9516,9598,9679,9760,9841,9921,10001,10080,10159,10238,10316
  1322.     dc.w    10394,10471,10549,10625,10702,10778,10853,10928,11003,11077,11151,11224,11297,11370,11442,11514
  1323.     dc.w    11585,11656,11727,11797,11866,11935,12004,12072,12140,12207,12274,12340,12406,12472,12537,12601
  1324.     dc.w    12665,12729,12792,12854,12916,12978,13039,13100,13160,13219,13279,13337,13395,13453,13510,13567
  1325.     dc.w    13623,13678,13733,13788,13842,13896,13949,14001,14053,14104,14155,14206,14256,14305,14354,14402
  1326.     dc.w    14449,14497,14543,14589,14635,14680,14724,14768,14811,14854,14896,14937,14978,15019,15059,15098
  1327.     dc.w    15137,15175,15213,15250,15286,15322,15357,15392,15426,15460,15493,15525,15557,15588,15619,15649
  1328.     dc.w    15679,15707,15736,15763,15791,15817,15843,15868,15893,15917,15941,15964,15986,16008,16029,16049
  1329.     dc.w    16069,16088,16107,16125,16143,16160,16176,16192,16207,16221,16235,16248,16261,16273,16284,16295
  1330.     dc.w    16305,16315,16324,16332,16340,16347,16353,16359,16364,16369,16373,16376,16379,16381,16383,16384
  1331. CosTable:    dc.w    16384,16384,16383,16381,16379,16376,16373,16369,16364,16359,16353,16347,16340,16332,16324,16315
  1332.     dc.w    16305,16295,16284,16273,16261,16248,16235,16221,16207,16192,16176,16160,16143,16125,16107,16088
  1333.     dc.w    16069,16049,16029,16008,15986,15964,15941,15917,15893,15868,15843,15817,15791,15763,15736,15707
  1334.     dc.w    15679,15649,15619,15588,15557,15525,15493,15460,15426,15392,15357,15322,15286,15250,15213,15175
  1335.     dc.w    15137,15098,15059,15019,14978,14937,14896,14854,14811,14768,14724,14680,14635,14589,14543,14497
  1336.     dc.w    14449,14402,14354,14305,14256,14206,14155,14104,14053,14001,13949,13896,13842,13788,13733,13678
  1337.     dc.w    13623,13567,13510,13453,13395,13337,13279,13219,13160,13100,13039,12978,12916,12854,12792,12729
  1338.     dc.w    12665,12601,12537,12472,12406,12340,12274,12207,12140,12072,12004,11935,11866,11797,11727,11656
  1339.     dc.w    11585,11514,11442,11370,11297,11224,11151,11077,11003,10928,10853,10778,10702,10625,10549,10471
  1340.     dc.w    10394,10316,10238,10159,10080,10001,9921,9841,9760,9679,9598,9516,9434,9352,9269,9186
  1341.     dc.w    9102,9019,8935,8850,8765,8680,8595,8509,8423,8337,8250,8163,8076,7988,7900,7812
  1342.     dc.w    7723,7635,7545,7456,7366,7276,7186,7096,7005,6914,6823,6731,6639,6547,6455,6363
  1343.     dc.w    6270,6177,6084,5990,5897,5803,5708,5614,5520,5425,5330,5235,5139,5044,4948,4852
  1344.     dc.w    4756,4660,4563,4467,4370,4273,4176,4078,3981,3883,3786,3688,3590,3492,3393,3295
  1345.     dc.w    3196,3098,2999,2900,2801,2702,2603,2503,2404,2305,2205,2105,2006,1906,1806,1706
  1346.     dc.w    1606,1506,1406,1306,1205,1105,1005,904,804,704,603,503,402,302,201,101
  1347.     dc.w    0,-101,-201,-302,-402,-503,-603,-703,-804,-904,-1005,-1105,-1205,-1306,-1406,-1506
  1348.     dc.w    -1606,-1706,-1806,-1906,-2006,-2105,-2205,-2305,-2404,-2503,-2603,-2702,-2801,-2900,-2999,-3098
  1349.     dc.w    -3196,-3295,-3393,-3492,-3590,-3688,-3786,-3883,-3981,-4078,-4176,-4273,-4370,-4467,-4563,-4660
  1350.     dc.w    -4756,-4852,-4948,-5044,-5139,-5235,-5330,-5425,-5520,-5614,-5708,-5803,-5897,-5990,-6084,-6177
  1351.     dc.w    -6270,-6363,-6455,-6547,-6639,-6731,-6823,-6914,-7005,-7096,-7186,-7276,-7366,-7456,-7545,-7635
  1352.     dc.w    -7723,-7812,-7900,-7988,-8076,-8163,-8250,-8337,-8423,-8509,-8595,-8680,-8765,-8850,-8935,-9019
  1353.     dc.w    -9102,-9186,-9269,-9352,-9434,-9516,-9598,-9679,-9760,-9840,-9921,-10001,-10080,-10159,-10238,-10316
  1354.     dc.w    -10394,-10471,-10549,-10625,-10702,-10778,-10853,-10928,-11003,-11077,-11151,-11224,-11297,-11370,-11442,-11514
  1355.     dc.w    -11585,-11656,-11727,-11797,-11866,-11935,-12004,-12072,-12140,-12207,-12274,-12340,-12406,-12472,-12537,-12601
  1356.     dc.w    -12665,-12729,-12792,-12854,-12916,-12978,-13039,-13100,-13160,-13219,-13279,-13337,-13395,-13453,-13510,-13567
  1357.     dc.w    -13623,-13678,-13733,-13788,-13842,-13896,-13949,-14001,-14053,-14104,-14155,-14206,-14256,-14305,-14354,-14402
  1358.     dc.w    -14449,-14497,-14543,-14589,-14635,-14680,-14724,-14768,-14811,-14854,-14896,-14937,-14978,-15019,-15059,-15098
  1359.     dc.w    -15137,-15175,-15213,-15250,-15286,-15322,-15357,-15392,-15426,-15460,-15493,-15525,-15557,-15588,-15619,-15649
  1360.     dc.w    -15679,-15707,-15736,-15763,-15791,-15817,-15843,-15868,-15893,-15917,-15941,-15964,-15986,-16008,-16029,-16049
  1361.     dc.w    -16069,-16088,-16107,-16125,-16143,-16160,-16176,-16192,-16207,-16221,-16235,-16248,-16261,-16273,-16284,-16295
  1362.     dc.w    -16305,-16315,-16324,-16332,-16340,-16347,-16353,-16359,-16364,-16369,-16373,-16376,-16379,-16381,-16383,-16384
  1363.     dc.w    -16384,-16384,-16383,-16381,-16379,-16376,-16373,-16369,-16364,-16359,-16353,-16347,-16340,-16332,-16324,-16315
  1364.     dc.w    -16305,-16295,-16284,-16273,-16261,-16248,-16235,-16221,-16207,-16192,-16176,-16160,-16143,-16125,-16107,-16088
  1365.     dc.w    -16069,-16049,-16029,-16008,-15986,-15964,-15941,-15917,-15893,-15868,-15843,-15817,-15791,-15763,-15736,-15707
  1366.     dc.w    -15679,-15649,-15619,-15588,-15557,-15525,-15493,-15460,-15426,-15392,-15357,-15322,-15286,-15250,-15213,-15175
  1367.     dc.w    -15137,-15098,-15059,-15019,-14978,-14937,-14896,-14854,-14811,-14768,-14724,-14680,-14635,-14589,-14543,-14497
  1368.     dc.w    -14449,-14402,-14354,-14305,-14256,-14206,-14155,-14104,-14053,-14001,-13949,-13896,-13842,-13788,-13733,-13678
  1369.     dc.w    -13623,-13567,-13510,-13453,-13395,-13337,-13279,-13219,-13160,-13100,-13039,-12978,-12916,-12854,-12792,-12729
  1370.     dc.w    -12665,-12601,-12537,-12472,-12406,-12340,-12274,-12207,-12140,-12072,-12004,-11935,-11866,-11797,-11727,-11656
  1371.     dc.w    -11585,-11514,-11442,-11370,-11297,-11224,-11151,-11077,-11003,-10928,-10853,-10778,-10702,-10625,-10549,-10471
  1372.     dc.w    -10394,-10316,-10238,-10159,-10080,-10001,-9921,-9841,-9760,-9679,-9598,-9516,-9434,-9352,-9269,-9186
  1373.     dc.w    -9102,-9019,-8935,-8850,-8765,-8680,-8595,-8509,-8423,-8337,-8250,-8163,-8076,-7988,-7900,-7812
  1374.     dc.w    -7723,-7635,-7545,-7456,-7366,-7277,-7186,-7096,-7005,-6914,-6823,-6731,-6639,-6547,-6455,-6363
  1375.     dc.w    -6270,-6177,-6084,-5990,-5897,-5803,-5708,-5614,-5520,-5425,-5330,-5235,-5139,-5044,-4948,-4852
  1376.     dc.w    -4756,-4660,-4563,-4467,-4370,-4273,-4176,-4078,-3981,-3883,-3786,-3688,-3590,-3492,-3393,-3295
  1377.     dc.w    -3196,-3098,-2999,-2900,-2801,-2702,-2603,-2503,-2404,-2305,-2205,-2105,-2006,-1906,-1806,-1706
  1378.     dc.w    -1606,-1506,-1406,-1306,-1205,-1105,-1005,-904,-804,-704,-603,-503,-402,-302,-201,-101
  1379.     dc.w    0,101,201,302,402,503,603,704,804,904,1005,1105,1205,1306,1406,1506
  1380.     dc.w    1606,1706,1806,1906,2006,2105,2205,2305,2404,2503,2603,2702,2801,2900,2999,3098
  1381.     dc.w    3196,3295,3393,3492,3590,3688,3786,3883,3981,4078,4176,4273,4370,4467,4563,4660
  1382.     dc.w    4756,4852,4948,5044,5139,5235,5330,5425,5520,5614,5708,5803,5897,5990,6084,6177
  1383.     dc.w    6270,6363,6455,6547,6639,6731,6823,6914,7005,7096,7186,7276,7366,7456,7545,7635
  1384.     dc.w    7723,7812,7900,7988,8076,8163,8250,8337,8423,8509,8595,8680,8765,8850,8935,9019
  1385.     dc.w    9102,9186,9269,9352,9434,9516,9598,9679,9760,9841,9921,10001,10080,10159,10238,10316
  1386.     dc.w    10394,10471,10549,10625,10702,10778,10853,10928,11003,11077,11151,11224,11297,11370,11442,11514
  1387.     dc.w    11585,11656,11727,11797,11866,11935,12004,12072,12140,12207,12274,12340,12406,12472,12537,12601
  1388.     dc.w    12665,12729,12792,12854,12916,12978,13039,13100,13160,13219,13279,13337,13395,13453,13510,13567
  1389.     dc.w    13623,13678,13733,13788,13842,13896,13949,14001,14053,14104,14155,14206,14256,14305,14354,14402
  1390.     dc.w    14449,14497,14543,14589,14635,14680,14724,14768,14811,14854,14896,14937,14978,15019,15059,15098
  1391.     dc.w    15137,15175,15213,15250,15286,15322,15357,15392,15426,15460,15493,15525,15557,15588,15619,15649
  1392.     dc.w    15679,15707,15736,15763,15791,15817,15843,15868,15893,15917,15941,15964,15986,16008,16029,16049
  1393.     dc.w    16069,16088,16107,16125,16143,16160,16176,16192,16207,16221,16235,16248,16261,16273,16284,16295
  1394.     dc.w    16305,16315,16324,16332,16340,16347,16353,16359,16364,16369,16373,16376,16379,16381,16383,16384
  1395.  
  1396.  
  1397.  
  1398.  
  1399.     SECTION    VariableTing,bss
  1400.  
  1401.     CNOP    0,4
  1402. _Bss2Start:
  1403. MaxRast:    ds.w    1
  1404. VBlank:    ds.b    1
  1405.     IFEQ    Track-0
  1406. IWantOut:    ds.b    1
  1407.     ELSE
  1408.     ds.b    1
  1409. IWantOut:    EQU    $80
  1410.     ENDC
  1411. CodeBuffer:    ds.b    320*8*(MatrixSize*BytesPerDot+2)
  1412. CodeMulsTab:    ds.l    320*8
  1413. _CodeBufferEnd:
  1414. VerticalBuffer:    ds.w    256*2*MatrixSize
  1415. VerticalMulsTab:    ds.l    256*2
  1416. _VerticalBufferEnd:
  1417. InterpolBuffer:    ds.w    320*MatrixSize*2
  1418. _InterpolBufferEnd:
  1419. PerspCoords:    ds.w    2*8
  1420. SideBuffer1:    ds.w    MatrixSize*2
  1421. SideBuffer2:    ds.w    MatrixSize*2
  1422. FaceBuffer1:    ds.w    MatrixSize*MatrixSize*2
  1423. FaceBuffer2:    ds.w    MatrixSize*MatrixSize*2
  1424. ColorArray:    ds.l    256
  1425. TransTrin:    ds.w    1
  1426. TransPause:    ds.w    1
  1427. Story:    ds.w    1
  1428.     CNOP    0,4
  1429. _Bss2End:
  1430.  
  1431.  
  1432.  
  1433.  
  1434. *******************************************************************************
  1435. **
  1436. **  Og den vildeste copperliste...
  1437. **
  1438. *******************************************************************************
  1439.     SECTION    MyCopper,data_c
  1440.  
  1441. FadeCopper:    dc.w    Bplcon0,$0201
  1442.     dc.w    $1001,$fffe
  1443. .col    dc.w    Color00,0
  1444.     dc.l    -2
  1445.  
  1446. Copper:    dc.w    $1001,$fffe
  1447.     dc.w    Bplcon0,$0201
  1448.     dc.w    Bplcon1,$0000
  1449.     dc.w    Bplcon2,$0024
  1450.     IFEQ    ECS-0
  1451.     dc.w    Bplcon3,$0c40
  1452.     dc.w    $01e4,$0000
  1453.     dc.w    $01fc,$0003
  1454.     ENDC
  1455.  
  1456.     dc.w    Spr0pth,0,Spr0ptl,0
  1457.     dc.w    Spr1pth,0,Spr1ptl,0
  1458.     dc.w    Spr2pth,0,Spr2ptl,0
  1459.     dc.w    Spr3pth,0,Spr3ptl,0
  1460.     dc.w    Spr4pth,0,Spr4ptl,0
  1461.     dc.w    Spr5pth,0,Spr5ptl,0
  1462.     dc.w    Spr6pth,0,Spr6ptl,0
  1463.     dc.w    Spr7pth,0,Spr7ptl,0
  1464.  
  1465. AGA_Colors:    IFEQ    ECS-1
  1466.     blk.l    32,0
  1467.     ELSE
  1468.     blk.l    33*8*2,0
  1469.     ENDC
  1470.  
  1471.     dc.w    $1801,$fffe
  1472. Copper_PlanePtr:    dc.w    Bpl1pth,0,Bpl1ptl,0
  1473.     dc.w    Bpl2pth,0,Bpl2ptl,0
  1474.     dc.w    Bpl3pth,0,Bpl3ptl,0
  1475.     dc.w    Bpl4pth,0,Bpl4ptl,0
  1476.     dc.w    Bpl5pth,0,Bpl5ptl,0
  1477.     IFEQ    ECS-0
  1478.     dc.w    Bpl6pth,0,Bpl6ptl,0
  1479.     dc.w    Bpl7pth,0,Bpl7ptl,0
  1480.     dc.w    Bpl8pth,0,Bpl8ptl,0
  1481.     ENDC
  1482.  
  1483.     IFEQ    ECS-0
  1484.     dc.w    $010c,$0011
  1485.     dc.w    Bplcon3,$0c40
  1486.     ENDC
  1487.     dc.w    Bplcon2,$0224
  1488.     dc.w    Ddfstrt,$0038
  1489.     dc.w    Ddfstop,$00d0
  1490.     dc.w    Diwstrt,$3081
  1491.     dc.w    Diwstop,$30c1
  1492.     dc.w    Bplcon1,$0000
  1493.     IFEQ    ECS-1
  1494.     dc.w    Bpl1mod,40
  1495.     dc.w    Bpl2mod,40
  1496.     ELSE
  1497.     dc.w    Bpl1mod,40-8
  1498.     dc.w    Bpl2mod,40-8
  1499.     ENDC
  1500.  
  1501.     dc.w    $2f01,$fffe
  1502.     IFEQ    ECS-1
  1503.     dc.w    Bplcon0,$5200
  1504.     ELSE
  1505.     dc.w    Bplcon0,$0210
  1506.     ENDC
  1507.  
  1508.     dc.w    $106,$c40
  1509.  
  1510. CirkelLine:    EQU    $91
  1511.  
  1512. Cirkel1:    MACRO
  1513.     IFEQ    (CirkelLine+\1)-$100
  1514.     IFEQ    ECS-0
  1515.     dc.w    $ffd9,$fffe
  1516.     ELSE
  1517.     dc.w    $ffe1,$fffe
  1518.     ENDC
  1519.     ENDC
  1520.     IF    ((CirkelLine+\1)>$12f)&(ECS-1)
  1521.     dc.w    ((CirkelLine+\1)&$ff)<<8!$91,$fffe
  1522.     dc.w    Color00,$103
  1523.     dc.w    ((CirkelLine+\1)&$ff)<<8!$c9,$fffe
  1524.     ELSE
  1525.     dc.w    ((CirkelLine+\1)&$ff)<<8!$93,$fffe
  1526.     dc.w    Color00,$103
  1527.     dc.w    ((CirkelLine+\1)&$ff)<<8!$cb,$fffe
  1528.     ENDC
  1529.     dc.w    Color00,$103
  1530.     ENDM
  1531.  
  1532. CirkelTing:    MACRO
  1533.     Cirkel1    \1+0
  1534.     Cirkel1    \1+1
  1535.     Cirkel1    \1+2
  1536.     Cirkel1    \1+3
  1537.     Cirkel1    \1+4
  1538.     Cirkel1    \1+5
  1539.     Cirkel1    \1+6
  1540.     Cirkel1    \1+7
  1541.     ENDM
  1542.  
  1543.     CirkelTing    0
  1544.     CirkelTing    8
  1545.     CirkelTing    8*2
  1546.     CirkelTing    8*3
  1547.     CirkelTing    8*4
  1548.     CirkelTing    8*5
  1549.     CirkelTing    8*6
  1550.     CirkelTing    8*7
  1551.     CirkelTing    8*8
  1552.     CirkelTing    8*9
  1553.     CirkelTing    8*10
  1554.     CirkelTing    8*11
  1555.     CirkelTing    8*12
  1556.     CirkelTing    8*13
  1557.     CirkelTing    8*14
  1558.     CirkelTing    8*15
  1559.     CirkelTing    8*16
  1560.     CirkelTing    8*17
  1561.     CirkelTing    8*18
  1562.     CirkelTing    8*19
  1563.     CirkelTing    8*20
  1564. DezignJohn:
  1565.  
  1566.  
  1567.     dc.l    -2
  1568.     dc.l    -2
  1569.  
  1570.  
  1571.  
  1572.  
  1573. *******************************************************************************
  1574. **
  1575. **  Screens+Gfx
  1576. **
  1577. *******************************************************************************
  1578.     SECTION    Screens,bss_c
  1579.  
  1580.     CNOP    0,8
  1581. _Bss1Start:
  1582. Screen1:    ds.b    256*80
  1583. Screen2:    ds.b    256*80
  1584. Screen3:    ds.b    256*80
  1585. Screen4:    ds.b    256*80
  1586. Screen5:    ds.b    256*80
  1587. Screen6:    ds.b    256*80
  1588. Screen7:    ds.b    256*80
  1589.     IFEQ    ECS-0
  1590. Screen8:    ds.b    256*80
  1591. Screen9:    ds.b    256*80
  1592. Screen10:    ds.b    256*80
  1593.     ENDC
  1594.     CNOP    0,4
  1595. _Bss1End:
  1596.  
  1597.  
  1598.  
  1599.  
  1600. *******************************************************************************
  1601. **
  1602. **  Print info on program
  1603. **
  1604. *******************************************************************************
  1605.  
  1606.     PRINTT    '          '
  1607.     PRINTT    'Code buffer size:'
  1608.     PRINTV    _CodeBufferEnd-CodeBuffer
  1609.     PRINTT    'Vertical buffer size:'
  1610.     PRINTV    _VerticalBufferEnd-VerticalBuffer
  1611.     PRINTT    'Interpol buffer size:'
  1612.     PRINTV    _InterpolBufferEnd-InterpolBuffer
  1613.     PRINTT    'Buffers ialt'
  1614.     PRINTV    _InterpolBufferEnd-InterpolBuffer+_CodeBufferEnd-CodeBuffer+_VerticalBufferEnd-VerticalBuffer
  1615.     PRINTT
  1616.     PRINTT    'Bitplaner:'
  1617.     PRINTV    _Bss1End-_Bss1Start
  1618.     PRINTT
  1619.     PRINTT    'MatrixSize:'
  1620.     PRINTV    MatrixSize
  1621.     PRINTT    'Dots ialt:'
  1622.     PRINTV    MatrixSize*MatrixSize*MatrixSize
  1623.  
  1624.  
  1625. *******************************************************************************
  1626. **
  1627. **  Hardware registers
  1628. **
  1629. *******************************************************************************
  1630. Bltddat:    EQU    $000
  1631. Dmaconr:    EQU    $002
  1632. Vposr:    EQU    $004
  1633. Vhposr:    EQU    $006
  1634. Dskdatr:    EQU    $008
  1635. Joy0dat:    EQU    $00a
  1636. Joy1dat:    EQU    $00c
  1637. Clxdat:    EQU    $00e
  1638. Adkconr:    EQU    $010
  1639. Pot0dat:    EQU    $012
  1640. Pot1dat:    EQU    $014
  1641. Potgor:    EQU    $016
  1642. Serdatr:    EQU    $018
  1643. Dskbytr:    EQU    $01a
  1644. Intenar:    EQU    $01c
  1645. Intreqr:    EQU    $01e
  1646. Dskpth:    EQU    $020
  1647. Dskptl:    EQU    $022
  1648. Dsklen:    EQU    $024
  1649. Dskdat:    EQU    $026
  1650. Refptr:    EQU    $028
  1651. Vposw:    EQU    $02a
  1652. Vhposw:    EQU    $02c
  1653. Copcon:    EQU    $02e
  1654. Serdat:    EQU    $030
  1655. Serper:    EQU    $032
  1656. Potgo:    EQU    $034
  1657. Joytest:    EQU    $036
  1658. Strequ:    EQU    $038
  1659. Strvbl:    EQU    $03a
  1660. Strhor:    EQU    $03c
  1661. Strlong:    EQU    $03e
  1662. Bltcon0:    EQU    $040
  1663. Bltcon1:    EQU    $042
  1664. Bltafwm:    EQU    $044
  1665. Bltalwm:    EQU    $046
  1666. Bltcpth:    EQU    $048
  1667. Bltcptl:    EQU    $04a
  1668. Bltbpth:    EQU    $04c
  1669. Bltbptl:    EQU    $04e
  1670. Bltapth:    EQU    $050
  1671. Bltaptl:    EQU    $052
  1672. Bltdpth:    EQU    $054
  1673. Bltdptl:    EQU    $056
  1674. Bltsize:    EQU    $058
  1675. Bltcmod:    EQU    $060
  1676. Bltbmod:    EQU    $062
  1677. Bltamod:    EQU    $064
  1678. Bltdmod:    EQU    $066
  1679. Bltcdat:    EQU    $070
  1680. Bltbdat:    EQU    $072
  1681. Bltadat:    EQU    $074
  1682. Dsksync:    EQU    $07e
  1683. Cop1lch:    EQU    $080
  1684. Cop1lcl:    EQU    $082
  1685. Cop2lch:    EQU    $084
  1686. Cop2lcl:    EQU    $086
  1687. Copjmp1:    EQU    $088
  1688. Copjmp2:    EQU    $08a
  1689. Copins:    EQU    $08c
  1690. Diwstrt:    EQU    $08e
  1691. Diwstop:    EQU    $090
  1692. Ddfstrt:    EQU    $092
  1693. Ddfstop:    EQU    $094
  1694. Dmacon:    EQU    $096
  1695. Clxcon:    EQU    $98
  1696. Intena:    EQU    $09a
  1697. Intreq:    EQU    $09c
  1698. Adkcon:    EQU    $09e
  1699. Aud0dat:    EQU    $0aa
  1700. Aud1dat:    EQU    $0ba
  1701. Aud2dat:    EQU    $0ca
  1702. Aud3dat:    EQU    $0da
  1703. Aud0lch:    EQU    $0a0
  1704. Aud1lch:    EQU    $0b0
  1705. Aud2lch:    EQU    $0c0
  1706. Aud3lch:    EQU    $0d0
  1707. Aud0len:    EQU    $0a4
  1708. Aud1len:    EQU    $0b4
  1709. Aud2len:    EQU    $0c4
  1710. Aud3len:    EQU    $0d4
  1711. Aud0per:    EQU    $0a6
  1712. Aud1per:    EQU    $0b6
  1713. Aud2per:    EQU    $0c6
  1714. Aud3per:    EQU    $0d6
  1715. Aud0vol:    EQU    $0a8
  1716. Aud1vol:    EQU    $0b8
  1717. Aud2vol:    EQU    $0c8
  1718. Aud3vol:    EQU    $0d8
  1719. Aud0lcl:    EQU    $0a2
  1720. Aud1lcl:    EQU    $0b2
  1721. Aud2lcl:    EQU    $0c2
  1722. Aud3lcl:    EQU    $0d2
  1723. Bpl1pth:    EQU    $0e0
  1724. Bpl1ptl:    EQU    $0e2
  1725. Bpl2pth:    EQU    $0e4
  1726. Bpl2ptl:    EQU    $0e6
  1727. Bpl3pth:    EQU    $0e8
  1728. Bpl3ptl:    EQU    $0ea
  1729. Bpl4pth:    EQU    $0ec
  1730. Bpl4ptl:    EQU    $0ee
  1731. Bpl5pth:    EQU    $0f0
  1732. Bpl5ptl:    EQU    $0f2
  1733. Bpl6pth:    EQU    $0f4
  1734. Bpl6ptl:    EQU    $0f6
  1735. Bpl7pth:    EQU    $0f8
  1736. Bpl7ptl:    EQU    $0fa
  1737. Bpl8pth:    EQU    $0fc
  1738. Bpl8ptl:    EQU    $0fe
  1739. Bplcon0:    EQU    $100
  1740. Bplcon1:    EQU    $102
  1741. Bplcon2:    EQU    $104
  1742. Bplcon3:    EQU    $106
  1743. Bpl1mod:    EQU    $108
  1744. Bpl2mod:    EQU    $10a
  1745. Bpl1dat:    EQU    $110
  1746. Bpl2dat:    EQU    $112
  1747. Bpl3dat:    EQU    $114
  1748. Bpl4dat:    EQU    $116
  1749. Bpl5dat:    EQU    $118
  1750. Bpl6dat:    EQU    $11a
  1751. Spr0pth:    EQU    $120
  1752. Spr0ptl:    EQU    $122
  1753. Spr1pth:    EQU    $124
  1754. Spr1ptl:    EQU    $126
  1755. Spr2pth:    EQU    $128
  1756. Spr2ptl:    EQU    $12a
  1757. Spr3pth:    EQU    $12c
  1758. Spr3ptl:    EQU    $12e
  1759. Spr4pth:    EQU    $130
  1760. Spr4ptl:    EQU    $132
  1761. Spr5pth:    EQU    $134
  1762. Spr5ptl:    EQU    $136
  1763. Spr6pth:    EQU    $138
  1764. Spr6ptl:    EQU    $13a
  1765. Spr7pth:    EQU    $13c
  1766. Spr7ptl:    EQU    $13e
  1767. Spr0pos:    EQU    $140
  1768. Spr0ctl:    EQU    $142
  1769. Spr0data:    EQU    $144
  1770. Spr0datb:    EQU    $146
  1771. Spr1pos:    EQU    $148
  1772. Spr1ctl:    EQU    $14a
  1773. Spr1data:    EQU    $14c
  1774. Spr1datb:    EQU    $14e
  1775. Spr2pos:    EQU    $150
  1776. Spr2ctl:    EQU    $152
  1777. Spr2data:    EQU    $154
  1778. Spr2datb:    EQU    $156
  1779. Spr3pos:    EQU    $158
  1780. Spr3ctl:    EQU    $15a
  1781. Spr3data:    EQU    $15c
  1782. Spr3datb:    EQU    $15e
  1783. Spr4pos:    EQU    $160
  1784. Spr4ctl:    EQU    $162
  1785. Spr4data:    EQU    $164
  1786. Spr4datb:    EQU    $166
  1787. Spr5pos:    EQU    $168
  1788. Spr5ctl:    EQU    $16a
  1789. Spr5data:    EQU    $16c
  1790. Spr5datb:    EQU    $16e
  1791. Spr6pos:    EQU    $170
  1792. Spr6ctl:    EQU    $172
  1793. Spr6data:    EQU    $174
  1794. Spr6datb:    EQU    $176
  1795. Spr7pos:    EQU    $178
  1796. Spr7ctl:    EQU    $17a
  1797. Spr7data:    EQU    $17c
  1798. Spr7datb:    EQU    $17e
  1799. Color00:    EQU    $180
  1800. Color01:    EQU    $182
  1801. Color02:    EQU    $184
  1802. Color03:    EQU    $186
  1803. Color04:    EQU    $188
  1804. Color05:    EQU    $18a
  1805. Color06:    EQU    $18c
  1806. Color07:    EQU    $18e
  1807. Color08:    EQU    $190
  1808. Color09:    EQU    $192
  1809. Color10:    EQU    $194
  1810. Color11:    EQU    $196
  1811. Color12:    EQU    $198
  1812. Color13:    EQU    $19a
  1813. Color14:    EQU    $19c
  1814. Color15:    EQU    $19e
  1815. Color16:    EQU    $1a0
  1816. Color17:    EQU    $1a2
  1817. Color18:    EQU    $1a4
  1818. Color19:    EQU    $1a6
  1819. Color20:    EQU    $1a8
  1820. Color21:    EQU    $1aa
  1821. Color22:    EQU    $1ac
  1822. Color23:    EQU    $1ae
  1823. Color24:    EQU    $1b0
  1824. Color25:    EQU    $1b2
  1825. Color26:    EQU    $1b4
  1826. Color27:    EQU    $1b6
  1827. Color28:    EQU    $1b8
  1828. Color29:    EQU    $1ba
  1829. Color30:    EQU    $1bc
  1830. Color31:    EQU    $1be
  1831. _Custom:    EQU    $dff000
  1832.  
  1833.  
  1834.  
  1835.  
  1836. *******************************************************************************
  1837. **
  1838. **  Interrupt addresses
  1839. **
  1840. *******************************************************************************
  1841. Lev1Base:    EQU    $64
  1842. Lev2Base:    EQU    $68
  1843. Lev3Base:    EQU    $6c
  1844. Lev4Base:    EQU    $70
  1845. Lev5Base:    EQU    $74
  1846. Lev6Base:    EQU    $78
  1847. Lev7Base:    EQU    $7c
  1848. Trap0:    EQU    $80
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.